/**
 * 
 */
package com.test;

import com.hnatourism.hbe.channel.dao.IChannelDao;
import com.hnatourism.hbe.channel.domain.Channel;

/**
 * @author leiping_zhu
 *
 */
public class HelloWorldFlex {

	private IChannelDao channelDao;

	public String helloJavaFlex(String channelCode) {
		String str = "Hello " + channelCode + " welcome to the flex world!";
		System.out.println(str);
		Channel channel = new Channel();
		channel.setChannelCode(channelCode);
		channel = channelDao.queryChannelByCode(channel);
		if(channel == null) {
			return "";
		}
		//return channel.getChannelCode() + ":" + channel.getChannelName();
		String json = "{ChannelCode:"+channel.getChannelCode()+", ChannelName:"+channel.getChannelName()+"}";
		System.out.println(json);
		return json;
	}

	public void setChannelDao(IChannelDao channelDao) {
		this.channelDao = channelDao;
	}
}
